package com.agent.vpsserver.modules.server.common.constants;

/**
 * @author: guochao
 * @create: 2024/3/13
 **/
public class CommandConstant {
    private CommandConstant() {
    }

    /**
     * 创建用户
     */
    public static final String CREATE_USER_COMMAND = "htpasswd -b /etc/squid/passwd %s %s";
    /**
     * 流量汇总
     */
    public static final String STATISTICS_COMMAND = "cat /var/log/squid/access.log | awk -v start_time=%d -v end_time=%d '{ gsub(\"\\\\.\", \"\", $1); if ($1 >= start_time && $1 <= end_time) sum[$8] += $5 } END { for (key in sum) print key, sum[key] }'";
    /**
     * 移除用户
     */
    public static final String REMOVE_USER_COMMAND = "htpasswd -D /etc/squid/passwd %s";
    /**
     * 重启squid
     */
    public static final String SQUID_RECONFIGURE_COMMAND = "squid -k reconfigure";
}
